<?php
include_once("king_head.php");
include_once("config.php");
if(isset($_POST["btn_cat"]))
{
	$uqry="Update product_master set product_category='$newcat' where product_category='$sel_cat'";
	//echo $uqry;
	mysql_query($uqry);
}
?>
<CENTER>
<H2> Category Management</H2>
<form method="post" action="manage_cat.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>">
<input type=hidden name=site_id value="<?php echo $_SESSION['SITE_ID']; ?>">
<TABLE width=400 height="116">
<TABLE width=386 height="93">
<tr><td width='134' height="8">
  Select a Category</td>
  <td height="8" width="242">
  <select name="sel_cat">
<?php 
	$cqry="SELECT distinct(product_category) FROM product_master";
	//echo $cqry;
	$cres = mysql_query($cqry);
	while($crow=mysql_fetch_array($cres))
	{
		$cat=$crow["product_category"];
//		echo $cat;
		echo "<option value=\"".$cat."\">".$cat."</option>";
	}	
?>
</select></td></tr>
<tr><td height="7" width="134">Move To</td>
  <td height="7" width="242">
 <input type="text" name="newcat" size="31"></td></tr>
<tr><td height="19" width="134">
&nbsp;</td>
<td height="19" width="242">
&nbsp;<input type="submit" value="Move Category" name="btn_cat"></td>
</tr>
</TABLE>
</TABLE></form>
</CENTER>
<?php
include_once("king_foot.php");
?>